import React from 'react';
import { Route, Switch, Redirect } from 'react-router-dom'
import News from './News';
import About from './About';
import Detail from './Detail';
const Father = () => {
    return (
        <div>

            {/* 定义路由规则及渲染坑 */}
            <Switch>
                <Route path='/news' component={News}></Route>
                <Route path='/about' component={About}></Route>
                <Route path='/detail/:id' component={Detail}></Route>
                <Redirect from='/' to='/news' exact></Redirect>
            </Switch>
        </div>
    );
}

export default Father;
